import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.baidu.com")
time.sleep(2)

driver.find_element(By.ID,'kw').send_keys('从入门到放弃')
time.sleep(2)
#这样可以找到 input的父级span标签
driver.find_element(By.XPATH,'//input[@id="su"]/..').click()


time.sleep(8)
driver.quit()
